
#ifdef a

/* ftell example : getting size of a file */
#include <stdio.h>

int main()
{
    FILE* pFile;
//    long size;

    pFile = fopen("myfile.txt", "r+");
    if (pFile == NULL) perror("Error opening file");
    else
    {
        fputs("12345", pFile);
        char arr[20] = { 0 };
      //  rewind(pFile);
        //printf("%d ",ftell(pFile));
        fseek(pFile,0, SEEK_SET);   // non-portable
        printf("%d\n", ftell(pFile));

       // printf("%s\n", fgets(arr,1,pFile));//只会读取n-1个字节，最后一个字节补'\0',以空格打印
       printf("%s\n", fgets(arr,1,pFile));//只会读取n-1个字节，最后一个字节补'\0',以空格打印
       //printf("size = %d", sizeof(fgets(arr, 10, pFile)));//指针一直是4个字节
        //size = ftell(pFile);
        fclose(pFile);
        //printf("Size of myfile.txt: %ld bytes.\n", size);
    }
    return 0;
}
#endif

